package io.gps.datatransfer.command;

import io.gps.datatransfer.utils.Utils;

public class DevServer {
    private String ip;
    private int port;
    private boolean ismaster=false;
    private boolean isUse=false;

    public String getIp() {
        return ip;
    }

    public int getPort() {
        return port;
    }

    public String getServerid() {
        return ip+":"+port;
    }

    public boolean isIsmaster() {
        return ismaster;
    }

    public boolean isUse() {
        return isUse;
    }

    public void setUse() {
        isUse =  Utils.isHostConnectable( this.ip, this.port);
    }

    public DevServer(String ip, int port, int mst) {
        this.ip = ip;
        this.port = port;
        this.ismaster=(mst==1);
    }
}
